package com.pulse.base.service;

import com.pulse.base.domain.CircuitMeasure;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
import java.util.Map;

/**
 * 光路监测Service接口
 *
 * @author 陆帅
 * @date 2024-07-17
 */
public interface ICircuitMeasureService {
    /**
     * 新增
     * @param circuitMeasure
     * @return
     */
    int insertCircuitMeasure(CircuitMeasure circuitMeasure);

    /**
     * 更新
     * @param circuitMeasure
     * @return
     */
    int updateCircuitMeasure(CircuitMeasure circuitMeasure);

    /**
     * 设置参考曲线
     *
     * @param measureId
     * @return
     */
    int setDefaultMeasure(Long measureId);

    /**
     * 查询光路监测列表
     *
     * @param circuitMeasure
     * @return
     */
    List<CircuitMeasure> selectCircuitMeasureList(CircuitMeasure circuitMeasure);

    /**
     * 删除光路监测曲线
     * @param measureIds
     * @return
     */
    int deleteCircuitMeasureByMeasureIds(Long[] measureIds);

    /**
     * 查看曲线
     *
     * @param measureIds
     * @return
     */
    List<Map<String, Object>> viewCurve(Long[] measureIds);

    /**
     * 查询光路监测曲线
     * @param measureId
     * @return
     */
    CircuitMeasure selectCircuitMeasureByMeasureId(Long measureId);

    /**
     * 根据曲线id查询参考曲线
     * @param measureId
     * @return
     */
    CircuitMeasure getDefaultMeasure(Long measureId);

    /**
     * 根据设备编号删除
     * @param deviceNo
     * @return
     */
    int deleteCircuitMeasureByDeviceNo(String deviceNo);

    /**
     * 导出sor文件
     *
     * @param response
     * @param circuitMeasure
     */
    void exportSor(HttpServletResponse response, CircuitMeasure circuitMeasure) throws IOException;

    /**
     * 导入sor文件
     * @param file
     * @param updateSupport
     * @param operName
     * @return
     */
    String importSor(MultipartFile file, boolean updateSupport, String operName);
}
